package com.ruoyi.crop.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.crop.api.domain.InventoryInquiry;
import com.ruoyi.crop.api.domain.Warehouse;
import com.ruoyi.crop.service.InventoryInquiryService;
import com.ruoyi.crop.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("tory")
public class InVenToryInQuIryController extends BaseController {

    @Autowired
    private InventoryInquiryService inventoryInquiryService;

    @Autowired
    private WarehouseService warehouseService;

    @GetMapping("list")
    public TableDataInfo list(InventoryInquiry inventoryInquiry){

        startPage();
        List<InventoryInquiry> list = inventoryInquiryService.listAll(inventoryInquiry);
        return getDataTable(list);
    }

    @GetMapping("wareList")
    public TableDataInfo wareList(){

        List<Warehouse> list = warehouseService.list();
        return getDataTable(list);
    }




}
